<?php
$tdatacountries=array();
	$tdatacountries[".NumberOfChars"]=80; 
	$tdatacountries[".ShortName"]="countries";
	$tdatacountries[".OwnerID"]="";
	$tdatacountries[".OriginalTable"]="countries";


	
//	field labels
$fieldLabelscountries = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelscountries["English"]=array();
	$fieldToolTipscountries["English"]=array();
	$fieldLabelscountries["English"]["id"] = "Id";
	$fieldToolTipscountries["English"]["id"] = "";
	$fieldLabelscountries["English"]["country_code"] = "Country Code";
	$fieldToolTipscountries["English"]["country_code"] = "";
	$fieldLabelscountries["English"]["country_name"] = "Country Name";
	$fieldToolTipscountries["English"]["country_name"] = "";
	if (count($fieldToolTipscountries["English"])){
		$tdatacountries[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Hong Kong S.A.R.)")
{
	$fieldLabelscountries["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldToolTipscountries["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldLabelscountries["Chinese (Hong Kong S.A.R.)"]["id"] = "Id";
	$fieldToolTipscountries["Chinese (Hong Kong S.A.R.)"]["id"] = "";
	$fieldLabelscountries["Chinese (Hong Kong S.A.R.)"]["country_code"] = "Country Code";
	$fieldToolTipscountries["Chinese (Hong Kong S.A.R.)"]["country_code"] = "";
	$fieldLabelscountries["Chinese (Hong Kong S.A.R.)"]["country_name"] = "Country Name";
	$fieldToolTipscountries["Chinese (Hong Kong S.A.R.)"]["country_name"] = "";
	if (count($fieldToolTipscountries["Chinese (Hong Kong S.A.R.)"])){
		$tdatacountries[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Taiwan)")
{
	$fieldLabelscountries["Chinese (Taiwan)"]=array();
	$fieldToolTipscountries["Chinese (Taiwan)"]=array();
	$fieldLabelscountries["Chinese (Taiwan)"]["id"] = "Id";
	$fieldToolTipscountries["Chinese (Taiwan)"]["id"] = "";
	$fieldLabelscountries["Chinese (Taiwan)"]["country_code"] = "Country Code";
	$fieldToolTipscountries["Chinese (Taiwan)"]["country_code"] = "";
	$fieldLabelscountries["Chinese (Taiwan)"]["country_name"] = "Country Name";
	$fieldToolTipscountries["Chinese (Taiwan)"]["country_name"] = "";
	if (count($fieldToolTipscountries["Chinese (Taiwan)"])){
		$tdatacountries[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="French")
{
	$fieldLabelscountries["French"]=array();
	$fieldToolTipscountries["French"]=array();
	$fieldLabelscountries["French"]["id"] = "Id";
	$fieldToolTipscountries["French"]["id"] = "";
	$fieldLabelscountries["French"]["country_code"] = "Country Code";
	$fieldToolTipscountries["French"]["country_code"] = "";
	$fieldLabelscountries["French"]["country_name"] = "Country Name";
	$fieldToolTipscountries["French"]["country_name"] = "";
	if (count($fieldToolTipscountries["French"])){
		$tdatacountries[".isUseToolTips"]=true;
	}
}


	
	$tdatacountries[".NCSearch"]=true;

	

$tdatacountries[".shortTableName"] = "countries";
$tdatacountries[".nSecOptions"] = 0;
$tdatacountries[".recsPerRowList"] = 1;	
$tdatacountries[".tableGroupBy"] = "0";
$tdatacountries[".mainTableOwnerID"] = "";
$tdatacountries[".moveNext"] = 1;




$tdatacountries[".showAddInPopup"] = false;

$tdatacountries[".showEditInPopup"] = false;

$tdatacountries[".showViewInPopup"] = false;


$tdatacountries[".fieldsForRegister"] = array();

$tdatacountries[".listAjax"] = true;

	$tdatacountries[".audit"] = false;

	$tdatacountries[".locking"] = false;
	
$tdatacountries[".listIcons"] = true;
$tdatacountries[".edit"] = true;
$tdatacountries[".inlineEdit"] = true;
$tdatacountries[".view"] = true;

$tdatacountries[".exportTo"] = true;

$tdatacountries[".printFriendly"] = true;

$tdatacountries[".delete"] = true;

$tdatacountries[".showSimpleSearchOptions"] = true;

$tdatacountries[".showSearchPanel"] = true;


$tdatacountries[".isUseAjaxSuggest"] = true;

$tdatacountries[".rowHighlite"] = true;


// button handlers file names

$tdatacountries[".addPageEvents"] = false;

$tdatacountries[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdatacountries[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdatacountries[".isUseTimeForSearch"] = false;

$tdatacountries[".isUseiBox"] = false;


$tdatacountries[".useDetailsPreview"] = true;	

$tdatacountries[".isUseInlineAdd"] = true;

$tdatacountries[".isUseInlineEdit"] = true;
$tdatacountries[".isUseInlineJs"] = $tdatacountries[".isUseInlineAdd"] || $tdatacountries[".isUseInlineEdit"];

$tdatacountries[".allSearchFields"] = array();

$tdatacountries[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacountries[".allSearchFields"]))
{
	$tdatacountries[".allSearchFields"][] = "id";	
}
$tdatacountries[".globSearchFields"][] = "country_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_code", $tdatacountries[".allSearchFields"]))
{
	$tdatacountries[".allSearchFields"][] = "country_code";	
}
$tdatacountries[".globSearchFields"][] = "country_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_name", $tdatacountries[".allSearchFields"]))
{
	$tdatacountries[".allSearchFields"][] = "country_name";	
}


$tdatacountries[".googleLikeFields"][] = "id";
$tdatacountries[".googleLikeFields"][] = "country_code";
$tdatacountries[".googleLikeFields"][] = "country_name";



$tdatacountries[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacountries[".allSearchFields"])) 
{
	$tdatacountries[".allSearchFields"][] = "id";	
}
$tdatacountries[".advSearchFields"][] = "country_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_code", $tdatacountries[".allSearchFields"])) 
{
	$tdatacountries[".allSearchFields"][] = "country_code";	
}
$tdatacountries[".advSearchFields"][] = "country_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_name", $tdatacountries[".allSearchFields"])) 
{
	$tdatacountries[".allSearchFields"][] = "country_name";	
}

$tdatacountries[".isTableType"] = "list";


	

$tdatacountries[".isDisplayLoading"] = true;

$tdatacountries[".isResizeColumns"] = false;

	$tdatacountries[".subQueriesSupAccess"] = true;




$tdatacountries[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdatacountries[".strOrderBy"] = $gstrOrderBy;
	
$tdatacountries[".orderindexes"] = array();

$tdatacountries[".sqlHead"] = "SELECT id,   country_code,   country_name";
$tdatacountries[".sqlFrom"] = "FROM countries";
$tdatacountries[".sqlWhereExpr"] = "";
$tdatacountries[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatacountries[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatacountries[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdatacountries[".Keys"] = $tableKeys;

//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "countries";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacountries["id"]=$fdata;
//	country_code
	$fdata = array();
	$fdata["strName"] = "country_code";
	$fdata["ownerTable"] = "countries";
		$fdata["Label"]="Country Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "country_code";
	
		$fdata["FullName"]= "country_code";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=5";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacountries["country_code"]=$fdata;
//	country_name
	$fdata = array();
	$fdata["strName"] = "country_name";
	$fdata["ownerTable"] = "countries";
		$fdata["Label"]="Country Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "country_name";
	
		$fdata["FullName"]= "country_name";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=25";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacountries["country_name"]=$fdata;

	
$tables_data["countries"]=&$tdatacountries;
$field_labels["countries"] = &$fieldLabelscountries;
$fieldToolTips["countries"] = &$fieldToolTipscountries;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["countries"] = array();
$dIndex = 1-1;
			$strOriginalDetailsTable="currencies";
	$detailsTablesData["countries"][$dIndex] = array(
		  "dDataSourceTable"=>"currencies"
		, "dOriginalTable"=>$strOriginalDetailsTable
		, "dShortTable"=>"currencies"
		, "masterKeys"=>array()
		, "detailKeys"=>array()
		, "dispChildCount"=> "1"
		, "hideChild"=>"0"
		, "sqlHead"=>"SELECT id,   currency_code,   currency_name,   country_id"	
		, "sqlFrom"=>"FROM currencies"	
		, "sqlWhere"=>""
		, "sqlTail"=>""
		, "groupBy"=>"0"
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 0
	);	
		$detailsTablesData["countries"][$dIndex]["masterKeys"][]="id";
		$detailsTablesData["countries"][$dIndex]["detailKeys"][]="country_id";

$dIndex = 2-1;
			$strOriginalDetailsTable="brc_items";
	$detailsTablesData["countries"][$dIndex] = array(
		  "dDataSourceTable"=>"brc_items"
		, "dOriginalTable"=>$strOriginalDetailsTable
		, "dShortTable"=>"brc_items"
		, "masterKeys"=>array()
		, "detailKeys"=>array()
		, "dispChildCount"=> "1"
		, "hideChild"=>"0"
		, "sqlHead"=>"SELECT id,   brc_id,   invoice_no,   invoice_date,   custom_no,   custom_date,   description,   blrawb_no,   blrawb_date,   country_id,   bill_amount,   currency_id,   freight_amount,   insurance_amount,   freely_convertable,   fob,   realisation_date,   sdf_form_no,   remarks"	
		, "sqlFrom"=>"FROM brc_items"	
		, "sqlWhere"=>""
		, "sqlTail"=>""
		, "groupBy"=>"0"
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 0
	);	
		$detailsTablesData["countries"][$dIndex]["masterKeys"][]="id";
		$detailsTablesData["countries"][$dIndex]["detailKeys"][]="country_id";


	
// tables which are master tables for current table (detail)
$masterTablesData["countries"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto627=array();
$proto627["m_strHead"] = "SELECT";
$proto627["m_strFieldList"] = "id,   country_code,   country_name";
$proto627["m_strFrom"] = "FROM countries";
$proto627["m_strWhere"] = "";
$proto627["m_strOrderBy"] = "";
$proto627["m_strTail"] = "";
$proto628=array();
$proto628["m_sql"] = "";
$proto628["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto628["m_column"]=$obj;
$proto628["m_contained"] = array();
$proto628["m_strCase"] = "";
$proto628["m_havingmode"] = "0";
$proto628["m_inBrackets"] = "0";
$proto628["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto628);

$proto627["m_where"] = $obj;
$proto630=array();
$proto630["m_sql"] = "";
$proto630["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto630["m_column"]=$obj;
$proto630["m_contained"] = array();
$proto630["m_strCase"] = "";
$proto630["m_havingmode"] = "0";
$proto630["m_inBrackets"] = "0";
$proto630["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto630);

$proto627["m_having"] = $obj;
$proto627["m_fieldlist"] = array();
						$proto632=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "countries"
));

$proto632["m_expr"]=$obj;
$proto632["m_alias"] = "";
$obj = new SQLFieldListItem($proto632);

$proto627["m_fieldlist"][]=$obj;
						$proto634=array();
			$obj = new SQLField(array(
	"m_strName" => "country_code",
	"m_strTable" => "countries"
));

$proto634["m_expr"]=$obj;
$proto634["m_alias"] = "";
$obj = new SQLFieldListItem($proto634);

$proto627["m_fieldlist"][]=$obj;
						$proto636=array();
			$obj = new SQLField(array(
	"m_strName" => "country_name",
	"m_strTable" => "countries"
));

$proto636["m_expr"]=$obj;
$proto636["m_alias"] = "";
$obj = new SQLFieldListItem($proto636);

$proto627["m_fieldlist"][]=$obj;
$proto627["m_fromlist"] = array();
												$proto638=array();
$proto638["m_link"] = "SQLL_MAIN";
			$proto639=array();
$proto639["m_strName"] = "countries";
$proto639["m_columns"] = array();
$proto639["m_columns"][] = "id";
$proto639["m_columns"][] = "country_code";
$proto639["m_columns"][] = "country_name";
$obj = new SQLTable($proto639);

$proto638["m_table"] = $obj;
$proto638["m_alias"] = "";
$proto640=array();
$proto640["m_sql"] = "";
$proto640["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto640["m_column"]=$obj;
$proto640["m_contained"] = array();
$proto640["m_strCase"] = "";
$proto640["m_havingmode"] = "0";
$proto640["m_inBrackets"] = "0";
$proto640["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto640);

$proto638["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto638);

$proto627["m_fromlist"][]=$obj;
$proto627["m_groupby"] = array();
$proto627["m_orderby"] = array();
$obj = new SQLQuery($proto627);

$queryData_countries = $obj;
$tdatacountries[".sqlquery"] = $queryData_countries;

$tableEvents["countries"] = new eventsBase;

?>
